package com.repairService.core.model;

/**
 * 应用模块名称
 *
 * @author Administrator
 * @since 2018/8/9 10:29
 */
public class ResponseJson {

    private String status;
    private String msg;
    private Object data;
    private String[] errors;

    public String[] getErrors() {
        return errors;
    }

    public String getStatus() {
        return status;
    }

    public String getMsg() {
        return msg;
    }

    public Object getData() {
        return data;
    }

    public ResponseJson() {}

    public ResponseJson(ResponseJson jsonResult) {
        this.data = jsonResult.data;
        this.msg = jsonResult.msg;
        this.status = jsonResult.status;
        this.errors = jsonResult.errors;
    }

    public static class Builder {
        private ResponseJson target;

        public Builder() {
            this.target = new ResponseJson();
        }

        public Builder(String status, String msg) {
            this.target = new ResponseJson();
            this.target.status = status;
            this.target.msg = msg;
        }

        public Builder(String status, String msg, String data) {
            this.target = new ResponseJson();
            this.target.status = status;
            this.target.msg = msg;
            this.target.data = data;
        }

        public Builder setStatus(String status) {
            target.status = status;
            return this;
        }

        public Builder setMsg(String msg) {
            target.msg = msg;
            return this;
        }

        public Builder setObj(Object data) {
            target.data = data;
            return this;
        }

        public Builder setErrors(String[] errors) {
            target.errors = errors;
            return this;
        }

        public ResponseJson build() {
            target = new ResponseJson(target);
            return target;
        }

    }

}
